f(char*a,char*b){return strcmp(a,b);}n;main(i)
{char b[150000][11];
	for(scanf("%d\n",&i);~i--;gets(b[n++]));qsort(b,--n,11,f);
	for(i=0;i<n;puts(b[i++]));
}
